﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dbPoll_Application.ViewModels.PollReportViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Reports
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="pageHeadingContainer"><h2 class="pageHeading">Poll Reports</h2></div>
    <div id="contentContainer">
        <p><%= Html.ActionLink("Polls > ", "Index", "Poll", null, new { @class = "breadcrumb" })%><%= Model.name %></p>
        <div id="pageMenuContainer">
            <span id="launchScreen"><%= Html.ActionLink("Go back to reports", "Reports", new { pollID = Model.pollID })%></span>
            <ul id="pageMenu">
                <li><%= Html.ActionLink("Details", "Questions", new { pollID = Model.pollID }) %></li>
                <li><%= Html.ActionLink("Run", "SetSession", new { pollID = Model.pollID }) %></li>
                <li><%= Html.ActionLink("Test", "Test", new { pollID = Model.pollID }) %></li>
                <li>Reports</li>
                <li><%= Html.ActionLink("Manage Hierarchy", "EntityHierarchy", new { pollID = Model.pollID })%></li>
            </ul>
        </div>
        <div>

        <h3><%=Model.name%></h3>
            <% using (Html.BeginForm("SessionPdf","Poll",FormMethod.Post)) { %>
                <input type="hidden" name="PollID" value="<%=Model.pollID %>" />
                <input type="hidden" id="type" name="type" value="Session Participation Report" />
                <input type="submit" value="Generate PDF" /><%}%>
        <table class="reports">
        <tr class="reports">
            <th class="reports">Participant</th>
            <th class="reports">Attended</th>
            <th class="reports">Participated (%)</th>
            <th class="reports">Points Accumulated</th>
        </tr>
        
        <% 
            foreach (var participant in Model.participants)
            {
        %>
       
        <tr class="reports">
            <td class="reports"><%=participant.firstName%> <%=participant.lastName%></td>
            <td class="reports"><%=participant.attended%></td>
            <td class="reports"><%=Model.participated(participant) %></td>
            <td class="reports"><%=Model.points(participant) %></td>
        </tr>
   
        <%
            }
        %>
   
   </table> 
    </div>
    </div>
   
        
</asp:Content>
